extern "C" { 
    #include "apue.h" 
}   
#include <stdio.h>
#include <unistd.h>        
#include <sys/types.h> 


//  uid_t getuid(void);        
//  uid_t geteuid(void); 
//  gid_t getgid(void);
//  gid_t getegid(void);
int main(int argc ,char** argv)
{
    uid_t uid=getuid();
    uid_t euid=geteuid();
    gid_t gid=getgid();
    gid_t egid=getegid();
    printf("uid=%d, euid=%d,gid=%d, egid=%d \n",uid,euid,gid,egid); 


}

/// ????
#if(0)
reallin@ubuntu:~/work/pan/apue/study/1-8-1$ ./exe  
uid=1000, euid=1000,gid=1000, egid=1000  
reallin@ubuntu:~/work/pan/apue/study/1-8-1$ sudo ./exe  
uid=0, euid=0,gid=0, egid=0 
#endif

